package com.beadwallet.alarm.config;

import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * @author 10400
 * @create 2017-05-31 12:31
 */
@Configuration
@ConditionalOnExpression( "${spring.web.interceptors.enabled:true}" )
public class WebAppConfig extends WebMvcConfigurerAdapter {


    /**
     * 配置拦截器
     * @author lance
     * @param registry
     */
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
//        registry.addInterceptor(new CorsInterceptor())
//                .addPathPatterns("/**");
//        registry.addInterceptor(new SessionInterceptor())
//                .addPathPatterns("/**")
//                .excludePathPatterns(
//                        "/ping"
//                        ,"/v2/api-docs"
//                        ,"/");
//        registry.addInterceptor(new AuthInterceptor())
//                .addPathPatterns("/**")
//                .excludePathPatterns(
//                        "/ping"
//                        ,"/v2/api-docs"
//                        ,"/"
//                        ,"/ruleEngine/*"
//                );
    }
}
